<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Sistema de Cadastro</title>
        <link rel="stylesheet" href="menu.css" type="text/css" />
    </h:head>
    <h:body>
        <ui:composition template="template.xhtml">
              <ui:define name="titulo">Sistema de Cadastro</ui:define>

        <ui:define name="body">
            <center>
        <h:form id="form" >
            <br/>
            <br/>
            <br/>
            <br/>
            <br/>
            <br/>
            <h:outputLabel value="Nome:    " id="nomeLabel" for="nome" />
           <h:inputText value="#{pessoaController.pessoa.nome}" id="nome" lang="45" label="nome"/>
            <br/>
   <h:outputLabel value="Evento:    " id="eventoLabel" for="evento" />
             <h:selectOneMenu id="evento" converter="evento"
                       value="#{pessoaController.pessoa.evento}">
                <f:selectItems
                    value="#{eventoController.todos}" var="item"  itemLabel="#{item.nome}"
                    itemValue="#{item}"/>
            </h:selectOneMenu>
   <br/>
   <h:commandButton value="Buscar " action="#{pessoaController.getBuscarPresentes()}"   /></h:form>
   
        <br/><br/><br/><br/>

</center>
        <h:form id="presente">
            <h:dataTable value="#{pessoaController.presentes}" var="item"
                         border="1"  cellpadding="2" cellspacing="0" columnClasses="" >
                <br/>
                <h:column>

                    <f:facet name="header">
                        <h:outputText value="Faculdades Existentes"/>
                    </f:facet>

                    <h:outputText value="#{item.nome}"/>
                </h:column>
                <h:column>

                    <f:facet name="header">
                        <h:outputText value="Presente"/>
                    </f:facet>



                    <h:selectBooleanCheckbox id="presente"  value="#{item.presente}" title=""  />
              
                    <h:commandButton value="Confirmar" action="#{pessoaController.confirma()}"   />
                    <h:commandButton value="Novo evento" action="#{pessoaController.novoCadastro}"   />
                
                </h:column>
         
            </h:dataTable>
        </h:form>
        </ui:define></ui:composition>

    </h:body>
</html>

